<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/jsp/common/head.jsp"%>

<div class="right">
     <div class="location">
         <strong>你现在所在的位置是:</strong>
         <span>订单管理页面 >> 订单添加页面</span>
     </div>
     <div class="providerAdd">
         <!-- 添加错误信息显示 -->
         <c:if test="${not empty error}">
             <div style="color: red; margin-bottom: 10px; padding: 10px; background-color: #ffe6e6; border: 1px solid #ff9999; border-radius: 5px;">
                 <strong>错误信息：</strong>${error}
             </div>
         </c:if>
         
         <form id="billForm" name="billForm" method="post" action="${pageContext.request.contextPath }/jsp/bill.do">
             <!--div的class 为error是验证错误，ok是验证成功-->
             <input type="hidden" name="method" value="add">
             <div class="">
                 <label for="billCode">订单编码：<span style="color: red;">*</span></label>
                 <input type="text" name="billCode" class="text" id="billCode" value="${bill.billCode}" required> 
				 <!-- 放置提示信息 -->
				 <font color="red"></font>
             </div>
             <div>
                 <label for="productName">商品名称：<span style="color: red;">*</span></label>
                 <input type="text" name="productName" id="productName" value="${bill.productName}" required> 
				 <font color="red"></font>
             </div>
             <div>
                 <label for="productDesc">商品描述：</label>
                 <input type="text" name="productDesc" id="productDesc" value="${bill.productDesc}">
                 <font color="red"></font>
             </div>
             <div>
                 <label for="productUnit">商品单位：</label>
                 <input type="text" name="productUnit" id="productUnit" value="${bill.productUnit}" required> 
				 <font color="red"></font>
             </div>
             <div>
                 <label for="productCount">商品数量：</label>
                 <input type="text" name="productCount" id="productCount" value="${bill.productCount}" required> 
				 <font color="red"></font>
             </div>
             <div>
                 <label for="totalPrice">总金额：</label>
                 <input type="text" name="totalPrice" id="totalPrice" value="${bill.totalPrice}" required> 
				 <font color="red"></font>
             </div>
             <div>
                 <label >供应商：</label>
                 <select name="providerId" id="providerId" required data-selected="${bill.providerId}">
                     <option value="0" ${bill.providerId == 0 ? 'selected="selected"' : ''}>--请选择--</option>
                 </select>
				 <font color="red"></font>
             </div>
             <div>
                 <label >是否付款：</label>
                 <input type="radio" name="isPayment" value="1" ${bill.isPayment == 1 ? 'checked="checked"' : ''}>未付款
				 <input type="radio" name="isPayment" value="2" ${bill.isPayment == 2 ? 'checked="checked"' : ''}>已付款
             </div>
             <div class="providerAddBtn">
                  <input type="button" name="add" id="add" value="保存">
				  <input type="button" id="back" name="back" value="返回" >
             </div>
             <div style="position: absolute; bottom: 20px; right: 20px;">
                 <div style="background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 15px; font-size: 12px; color: #6c757d; box-shadow: 0 2px 10px rgba(0,0,0,0.1);margin-right: 20px; margin-top: 15px; margin-bottom:40px">
                     <div style="font-weight: bold; margin-bottom: 10px; color: #495057; font-size: 14px;">💡 商品描述提示</div>
                     <div style="line-height: 1.6;">
                         <div style="margin-bottom: 8px;"><span style="color: #28a745; font-weight: bold;">日用品：</span>洗发水、沐浴露、牙膏、纸巾</div>
                         <div style="margin-bottom: 8px;"><span style="color: #007bff; font-weight: bold;">食品：</span>面包、饼干、巧克力、坚果</div>
                         <div style="margin-bottom: 8px;"><span style="color: #fd7e14; font-weight: bold;">饮料：</span>可乐、果汁、奶茶、咖啡</div>
                         <div><span style="color: #6f42c1; font-weight: bold;">矿泉水：</span>纯净水、天然水、矿物质水</div>
                     </div>
                 </div>
             </div>
         </form>
     </div>
 </div>
</section>
<%@include file="/jsp/common/foot.jsp" %>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/billadd.js"></script>